<?php
    #-------------------------------------------------------------#
	# This file is part of the Kumomado - Virtual Window Platform #
	# for PHP. (c) 2009 Tsai, Min Che <tirme0812@gmail.com>       #
	# Please visit http://www.kumomado.org/ for more information. #
	#                                                             #
	# This software is licensed under the GNU License v3. Please  #
	# view the LICENSE file for the full text of this license.    #
    #-------------------------------------------------------------#

	function __autoload($class_name) {
		$exception_regexp = '/[\w]*Exception$/';
		$object_regexp = '/[\w]*Object$/i';
		if (preg_match($object_regexp, $class_name)) {
			$class_file = KUMOMADO_OBJECTS_PATH.$class_name.'.class.php';
		} else if (preg_match($exception_regexp, $class_name)) {
			$class_file = KUMOMADO_EXCEPTIONS_PATH.$class_name.'.class.php';
		}
		if (file_exists($class_file)) {
			include_once $class_file;
		}
	}
	function alex($msg, $desc = '', $type = 'var') {
		echo '<pre style="border: 1px solid #F00">';
		//echo sprintf('<div style="color: #F00;">%s</div>', $desc);
		if ($type == 'var') {
			print_r($msg);
		}
		if ($type == 'dump') {
			var_dump($msg);
		}
		echo '</pre>';
	}
?>